﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Macds.Debug.Test.Mocks
{
    public class CustomerService : ICustomerService
    {
        public string GetEmail(int customerID)
        {
            return "demo@email.com";
        }

        public int GetCustomerID(string username)
        {
            return 1;
        }

        public bool CustomerExists(string username)
        {
            return true;
        }

        public Customer ValidateCustomer(string username, string password)
        {
            return new Customer { CustomerID = 1, Email = "demo@email.com", Username = "username", Password = "password" };
        }

        public bool ValidateCustomerOut(string username, string password, out Customer customer)
        {
            customer = ValidateCustomer(username, password);
            return true;
        }

        public void UpdateCustomer(Customer customer) 
        {
            //throw new Exception("manual error injected");
        }

        public List<Customer> FilterCustomers(IDictionary<string, string> filters)
        {
            var customers = new List<Customer>();
            customers.Add(InstanceFactory.GetSimpleCustomer());
            customers.Add(InstanceFactory.GetCustomerWithAddresses());

            return customers;
        }
    }
}
